﻿create function GetRateForProjectAndDate(@projectID int, @userID int,@currentDate datetime)
returns money
as
begin
declare @rate money

SELECT @rate= coalesce([HourlyRate],0)
  FROM [dbo].[ProjectMembers]
  where (@currentDate between StartDate and EndDate)  and 
		(UserID = @userID) and 
		(ProjectID=@projectID)
		return @rate
end